package org.example.common.exception;

import lombok.Data;
import org.example.result.ResultCodeEnum;


@Data
public class ZspException extends RuntimeException{
    private Integer code;//状态码
    private String message;//描述信息

    public  ZspException(Integer code,String message){
        super(message);
        this.code=code;
        this.message=message;
    }

    @Override
    public String toString() {
        return "GuliException{" +
                "code=" + code +
                ", message=" + this.getMessage() +
                '}';
    }
    public ZspException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
